home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / SPX30.ZIP / SPX_DOC.ZIP / SPX_SFN.DOC < prev    next >
Encoding:
Text File  |  1994-06-13  |  3.9 KB  |  113 lines

  1. { SPX Library Version 3.0  Copyright 1993 Scott D. Ramsay }
  2.  
  3.   SPX_SFN is the raster font handling unit.  It also allows you to
  4.   display your own fonts mono-or multicolor fonts.  Has a built in small
  5.   text font. (Font used in GUI- of vspmaker and geomaker.)
  6.  
  7.   You can make your own fonts using the VSP2SFN.EXE utility
  8.   or convert existing fonts to VSP format for editing. (SFN2VSP.EXE)
  9.  
  10. ───────────────────────────────────────────────────────────────────────────
  11.   type
  12.     psfn_type = ^sfn_type;
  13.     sfn_type = record
  14.                  w,h  : integer;
  15.                  data : pointer;
  16.                end;
  17.  
  18.     sfn_type defines a font type.
  19.  
  20.       w,h   define the font's maximum width and height.
  21.       data  is the font's actual data
  22.  
  23. ───────────────────────────────────────────────────────────────────────────
  24. var
  25.   SFNx       : integer;       { current X position }
  26.   currentSFN : psfn_type;     { pointer to the current font type }
  27.   sfnWidth   : array[0..255] of byte; { list of current font widths }
  28.   sfnHeight  : array[0..255] of byte; { list of current font heights }
  29.  
  30. ───────────────────────────────────────────────────────────────────────────
  31. function stlen(s:string):word;
  32.  
  33.    Returns the width of the string in pixels based on the current font.
  34.  
  35.    S: String to check
  36.  
  37. ───────────────────────────────────────────────────────────────────────────
  38. function LoadSfn(fn:string;var font:sfn_type):integer;
  39.  
  40.    Loads a .SFN font file from disk.  Returns 0 for no error or
  41.    a SFN error code.
  42.  
  43. ───────────────────────────────────────────────────────────────────────────
  44. function LoadSfnLib(lib:pSpxLib;fn:string;var font:sfn_type):integer;
  45.  
  46.    Loads a .SFN font from a SPX archive file.  Returns 0 for no error or
  47.    a SFN error code.
  48.  
  49. ───────────────────────────────────────────────────────────────────────────
  50. procedure SetSFN(var font:sfn_type);
  51.  
  52.    Sets the current font.
  53.  
  54.    font:  must be a valid pre-loaded font.
  55.  
  56. ───────────────────────────────────────────────────────────────────────────
  57. procedure SetSFNdefault;
  58.  
  59.   Set the current font to the internal font type
  60.  
  61. ───────────────────────────────────────────────────────────────────────────
  62. procedure FreeSfn(var font:sfn_type);
  63.  
  64.   Frees up a loaded font from memory
  65.  
  66. ───────────────────────────────────────────────────────────────────────────
  67. procedure printchar(x,y:integer;h:char);
  68.  
  69.    Displays a character using the current font.  Uses the font's
  70.    set colors.
  71.  
  72. ───────────────────────────────────────────────────────────────────────────
  73. procedure printletter(x,y:integer;s:string);
  74.  
  75.    Displays a string using the current font.  Uses the font's
  76.    set colors.
  77.  
  78.    X,Y: Top-left position to place text;
  79.    S:   String to display
  80.  
  81. ───────────────────────────────────────────────────────────────────────────
  82. procedure putletter(x,y:integer;c:byte;s:string);
  83.  
  84.    Display a string on the active page, using the current font. All non-zero
  85.    color on the font becomes a single color
  86.  
  87.    X,Y: Top-left position to place text;
  88.    C:   Color of text;
  89.    S:   String to display
  90.  
  91.    NOTE: IF (X) is negative then the text is centered on the screen
  92.  
  93. ───────────────────────────────────────────────────────────────────────────
  94. procedure drawletter(x,y:integer;c,c2:byte;s:string);
  95.  
  96.    Drawletter is the same as putletter with the following addition:
  97.  
  98.       putletter(x+1,y+1,c2,s);
  99.       putletter(x,y,c,s);
  100.  
  101.    This allows for shaded text.  Set the GUI's vspmaker and geomaker for
  102.   visual examples.
  103.  
  104. ───────────────────────────────────────────────────────────────────────────
  105. procedure putchar(x,y:integer;h:char;c:byte);
  106.  
  107.    Display a character on the active page using the current font.
  108.  
  109.    X,Y: Top-left position to place character;
  110.    H:   Character to display;
  111.    C:   Color of character
  112.  
  113. ───────────────────────────────────────────────────────────────────────────